package com.qdlc.p2p.biz.service;

import com.qdlc.p2p.dal.common.model.jpa.PageDataList;
import com.qdlc.p2p.dal.dto.EnjoyGoods;
import com.qdlc.p2p.dal.dto.EnjoyUpload;
import com.qdlc.p2p.dal.model.EnjoyGoodsModel;

import java.util.List;

/**
 * Created by D on 2016/1/20.
 */
public interface EnjoyGoodsService {

    /**
     * 获取有库存的商品
     */
    List<EnjoyGoods> findUsableEnjoyGoods();

    /**
     * 根据model进行查询
     * @param model
     * @return
     */
    PageDataList<EnjoyGoods> findByModel(EnjoyGoodsModel model);

    /**
     * 保存
     * @param EnjoyGoods
     * @return
     */
    void save(EnjoyGoods EnjoyGoods, List<EnjoyUpload> list);

    /**
     * 根据主键ID查询
     * @param id
     * @return
     */
    EnjoyGoods findById(long id);

    /**
     * 修改
     * @param EnjoyGoods
     * @return
     */
    void update(EnjoyGoods EnjoyGoods, List<EnjoyUpload> list, long[] ids);

    /**
     * 通过商品Id获取该商品所有图片
     */
    List<EnjoyUpload> findPicByGoodsId(long id);

    /**
     * 通过专区Id获取还未占据的位置
     */
    List<Integer> enablePosition(int prefecture);

    /**
     * 通过专区与商品ID获取还未占据的位置+商品位置
     */
    List<Integer> enablePosition(int prefecture, long enjoyGoodsId);

    /**
     * 判断商品是否与标关联
     */
    boolean isBorrow(long goodsId);
}
